package dungeonPackage;

import java.math.BigDecimal;

import squareBorderPackage.*;
import TemperaturePackage.*;

public class DungeonApplication {

	/**
	 * A dungeon with 4 squares is created and some actions will be performed on
	 * it
	 */
	public static void main(String[] args) {

		// preparatie vakjes

		Dungeon dungeon = new Dungeon(new Orientation(100, 100, 100));
		Square square1 = new Square(new Temperature(100, TemperatureUnit.CELSIUS), new BigDecimal(50), Direction.NORTH, Direction.EAST, Direction.WEST);
		Square square2 = new Square(new Temperature(90, TemperatureUnit.CELSIUS), new BigDecimal(25), Direction.NORTH, Direction.SOUTH, Direction.WEST);
		Square square3 = new Square(new Temperature(100, TemperatureUnit.CELSIUS), new BigDecimal(50), Direction.SOUTH, Direction.WEST);
		Square square4 = new Square(new Temperature(-30, TemperatureUnit.CELSIUS), new BigDecimal(70), Direction.NORTH, Direction.EAST);
		Square square5 = new Square(new Temperature(-30, TemperatureUnit.CELSIUS), new BigDecimal(50), Direction.EAST, Direction.WEST);
		
		new Door(false, square3, Direction.EAST);
		new Door(false, square4, Direction.WEST);

		// preparatie orientatie vakjes

		Orientation orientation1 = new Orientation(0, 10, 0);
		Orientation orientation2 = new Orientation(1, 10, 0);
		Orientation orientation3 = new Orientation(0, 11, 0);
		Orientation orientation4 = new Orientation(1, 11, 0);
		Orientation orientation5 = new Orientation(1, 12, 0);

		// vakjes op juiste orientatie in dungeon zetten

		dungeon.setSquareAt(orientation1, square1);
		dungeon.setSquareAt(orientation2, square2);
		dungeon.setSquareAt(orientation3, square3);
		dungeon.setSquareAt(orientation4, square4);
		dungeon.setSquareAt(orientation5, square5);

		// informatie over vakje (0,10,0) voor het openen van de deur uitprinten

		System.out.println("Status vakje (0,10,0) voor de deur geopend wordt.");
		System.out.println("Temperatuur: "
				+ square1.getTemperature().toString());
		System.out.println("Vochtigheidsgraad: "
				+ square1.getHumidity().toString());
		System.out.println("");
		System.out.println("");

		// Deur openen

		((Door) square3.getBorderAt(Direction.EAST)).setOpened(true);

		// Informatie over vakje (0,10,0) na het openen van de deur uitprinten.

		System.out.println("Status vakje (0,10,0) nadat de deur geopend werd.");
		System.out.println("Temperatuur: "
				+ square1.getTemperature().toString());
		System.out.println("Vochtigheidsgraad: "
				+ square1.getHumidity().toString());
		System.out.println("");
		System.out.println("");

	}

}
